package cn.li.system.service.impl;

import cn.li.basic.util.PageList;
import cn.li.system.domain.SystemLog;
import cn.li.system.mapper.SystemLogMapper;
import cn.li.system.query.SystemLogQuery;
import cn.li.system.service.ISystemLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SystemLogServiceImpl implements ISystemLogService {

    @Autowired
    private SystemLogMapper mapper;

    @Override
    public void saveLog(SystemLog syslog) {
        mapper.saveLog(syslog);
    }

    @Override
    public PageList<SystemLog> queryPage(SystemLogQuery query) {
        /*查询总条数*/
        Long total = mapper.queryCount(query);
        /* 查询当前页的数据*/
        List<SystemLog> rows = mapper.queryData(query);
        return new PageList<>(total,rows);
    }
}
